#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;
const int MOD = 104857601;

int n, m;
int np[N], phi[N];
ll f[N];
vector<int> primes;
void init(int n) {
  np[1] = phi[1] = 1;
  rep(i, 2, n) {
    if (!np[i]) {
      primes.push_back(i);
      phi[i] = i - 1;
    }
    for (int j : primes) {
      ll k = 1ll * j * i;
      if (k > n) break;
      np[k] = 1;
      if (i % j == 0) {
        phi[k] = phi[i] * j;
        break;
      } else
        phi[k] = phi[i] * (j - 1);
    }
  }
  rep(i, 1, n) f[i] = f[i - 1] + phi[i];
}
ll fastpow(ll b, ll p, ll mod) {
  ll res = 1;
  while (p) {
    if (p & 1) res = res * b % mod;
    b = b * b % mod;
    p >>= 1;
  }
  return res;
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  init(n);
  ll ans = 1;
  rep(i, 2, n) {
    ll mx = n / i;
    ll u = n * 2;
    ll v = 2 * (f[mx] * 2 - 1);
    if (u >= v)
      ans = ans * fastpow(i, u - v, MOD) % MOD;
    else {
      ll x = fastpow(i, v - u, MOD);
      ll y = fastpow(x, MOD - 2, MOD);
      ans = ans * y % MOD;
    }
  }
  cout << ans;
  return 0;
}